<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh-CN" data-theme="light">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>社区健康系统首页</title>
    <!-- 统一使用Bootstrap 5.3.2版本 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- FontAwesome图标 -->
    <link href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css" rel="stylesheet">
    <!-- 自定义样式 -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/style.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/chart.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/theme.css">
</head>

<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary shadow-sm sticky-top">
    <div class="container">
        <a class="navbar-brand fw-bold" href="#"><i class="fas fa-heartbeat me-2"></i>社区健康系统</a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
            <span class="navbar-toggler-icon"></span>
        </button>
        <div class="d-flex align-items-center order-lg-2">
            <button class="theme-toggle-btn btn btn-outline-light rounded-pill px-3"
                    id="themeToggleBtn" title="切换主题">
                <i class="fas fa-moon me-1"></i> 深色模式
            </button>
        </div>
        <div class="collapse navbar-collapse" id="navbarNav">
            <ul class="navbar-nav ms-auto">
                <li><a class="nav-link active" href="index.jsp">首页</a></li>
                <li><a class="nav-link" href="login.jsp" >查看公告</a></li>
                <li><a class="nav-link" href="login.jsp" >登录</a></li>
                <li><a class="nav-link" href="registration.jsp" >注册</a></li>
            </ul>
        </div>
    </div>
</nav>

<div class="container py-5">
    <h1 class="main-title text-center mb-4">社区老人健康信息总览</h1>
    <div class="row g-4">
        <div class="col-lg-7">
            <div class="card shadow-sm h-100">
                <div class="card-header bg-secondary text-white">
                    <i class="fas fa-users me-2"></i>老人健康信息表
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-hover align-middle" id="elders-table">
                            <thead class="table-light">
                            <tr>
                                <th>姓名</th>
                                <th>年龄</th>
                                <th>性别</th>
                                <th>联系方式</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <!-- 示例数据（实际开发中应由后端提供） -->
                            <tr>
                                <td>张大爷</td>
                                <td>72</td>
                                <td>男</td>
                                <td>138****5678</td>
                                <td>
                                    <button class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#detailModal">查看详情</button>
                                </td>
                            </tr>
                            <tr>
                                <td>李奶奶</td>
                                <td>68</td>
                                <td>女</td>
                                <td>139****6789</td>
                                <td>
                                    <button class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#detailModal">查看详情</button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-5">
            <div class="card shadow-sm h-100">
                <div class="card-header bg-info text-white">
                    <i class="fas fa-chart-line me-2"></i>体温变化趋势
                </div>
                <div class="card-body">
                    <div class="chart-container" data-chart-type="line">
                        <canvas id="temperatureChart"></canvas>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<footer class="footer mt-5 py-3 bg-light border-top">
    <div class="container text-center">
        <hr class="mb-3" />
        <span class="text-muted"><i class="fas fa-leaf me-1"></i>&copy; 2023 社区健康系统. All rights reserved.</span>
    </div>
</footer>

<!-- 引入依赖 -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- 自定义JS - 按模块拆分 -->
<script src="${pageContext.request.contextPath}/static/js/chart.js"></script>
<script src="${pageContext.request.contextPath}/static/js/theme.js"></script>
<script src="${pageContext.request.contextPath}/static/js/table.js"></script>
</body>